package com.xuhui.demo.mapper;

import com.xuhui.demo.bean.Book;
import org.apache.ibatis.annotations.*;

/**
 * 这里的值都要随着数据库改变
 */
@Mapper
public interface BookDao {

    @Insert("insert into tbl_book values (null,#{type},#{name},#{description})")
    void save(Book book);

    @Delete("delete  from tbl_book where id=#{id}")
    void delete(int id);

    @Update("update  tbl_book set type=#{type},name=#{name},description=#{description} where id=#{id}")
    void update(Book book);

    @Select("select * from tbl_book where id=#{id}")
    Book find(int id);



}